#include<iostream>
#include<set>
using namespace std;
set<int>s;
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		s.clear();
		cin >> n;
		int x;
		for (int i = 0; i < n; i++) {
			cin >> x;
			s.insert(x);
		}
		cout << s.size() << endl;
	}
	return 0;
}

